package pers.uang.crud.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import pers.uang.crud.pojo.Department;
import pers.uang.crud.service.DepartmentService;

import java.util.List;

@Controller
public class DepartmentController {

    @Autowired
    private DepartmentService departmentService;

    @GetMapping("/department")
    @ResponseBody
    public List<Department> getAllDepartmentAjax(){
        return departmentService.getAllDepartment();
    }
}
